<%--
  Created by IntelliJ IDEA.
  User: xiaoding
  Date: 2021/1/8
  Time: 9:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>左边</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/css/Style.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/css/left.css">
    <script src="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/js/JQuery.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
    <script>
        $(document).ready(function() {
            $.ajax({
                url : "${pageContext.request.contextPath}/AnnounceServlet?flag=select",//后台请求的数据，用的是PHP
                dataType : "json",//数据格式
                type : "post",//请求方式
                async : true,//是否异步请求
                success : function(data) {   //如果请求成功，返回数据。
                    //存储传输的数据
                    var json = "";
                    for (var i = 0;i<data.data.length;i++) {
                        json += "<label>发布人："+data.data[i].uName+"</label><br>"+"<label>发布时间："+data.data[i].publishingDate+"</label><br>"+"<label>内容："+data.data[i].content+"</label><br>"+"<label>发布时间：" + data.data[i].publishingDate +"</label><br>"+"<label>-------------------------------------</label><br>";
                    }
                    //将内容添加到公告中
                    $("#announce").html(json);
                },
            })
        })
    </script>
</head>
<body>
    <%-- 主体 --%>
    <div class="main-left">
        <div class="notice">
            <h3>系统公告</h3>
            <div class="lunbo_div">
                <marquee width="100%" id="announce" height="80%" direction="up" scrolldelay="200">

                </marquee>
            </div>
        </div>
        <div class="blogroll">
            <h3>友情链接</h3>
            <div class="blogroll-text">
                <p>
                    <a href="">CSDN博客</a>
                </p>
                <p>
                    <a href="">北京尚学堂</a>
                </p>
            </div>
        </div>
        <div class="download">
            <h3>源码下载</h3>
            <div class="download-text">
                <p>
                    <a href="https://blog.csdn.net/xiaoding520?spm=1010.2135.3001.5421">项目下载地址</a>
                    <a href="">我的博客</a>
                </p>
                <p>
                    <span>关注本博主，带你浏览各类IT技术</span>
                    <span>1、Java从入门到精通</span>
                    <span>2、IDEA遇到的坑</span>
                    <span>3、Java常见报错</span>
                    <span>4、数据结构与算法</span>
                    <span>5、Java毕业设计</span>
                </p>
            </div>
        </div>
    </div>

</body>
</html>
